<!--
 * @Author: your name
 * @Date: 2022-02-22 10:38:36
 * @LastEditTime: 2022-02-22 16:44:30
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \gitCK\day-4\float.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动布局</title>
    <style>
        html{
            font:12px '微软雅黑';
        }
        body{margin: 0;}
        ul{
            margin: 0;padding: 0;list-style: none;
        }
        .wrapper{
            width: 1080px;
            margin: 0 auto;
        }
        .xpsf{
            background-color: lightyellow;
        }
        .xpsf ul.p_list{

        }
        .xpsf ul.p_list::after{
            content: none;
            display: block;
            clear: both;
        }
        .xpsf ul.p_list>li{
            height: 100px;
            width: 200px;
            /*float: left;*/
        }
        .xpsf ul.p_list>li:nth-child(1){
            width: 200px;
            float: left;
        }
        .xpsf ul.p_list>li:nth-child(2){
            width: 200px;
            float: left;
        }
        .xpsf ul.p_list>li:nth-child(3){
            width: 200px;
            float: left;
        }
        .xpsf ul.p_list>li:nth-child(4){
            width: 200px;
            float: left;
        }
        .xpsf ul.p_list>div.clear{
            clear: left;
        }
        .rqtj{
            background-color: lightsalmon;
        }
        .jjsh{
            background-color: lightseagreen;
        }
    </style>
</head>
<body>
    <!--容器-->
    <div class="container">
        <!-- 新品首发-->        
        <div class="xpsf">
            <!--居中-->
            <div class="wrapper">
                <ul class="p_list">
                    <li>1</li>
                    <li>2</li>
                    <li>3</li>
                    <li>4</li>
                    <div class="clear">
                        hello
                    </div>
                </ul>
            </div>
        </div>
        <!--人气推荐-->
        <div class="rqtj">
            人气推荐
        </div>
        <!--居家生活-->
        <div class="jjsh">
            居家生活
        </div>
    </div>
</body>
</html>